﻿using Guild_Wars_2.APITools;
using Guild_Wars_2.Common;
using Windows.Data.Json;
using Windows.Data.Xml.Dom;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace Guild_Wars_2
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class BlankPage1 : Page
    {
        public BlankPage1()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private async void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var dyeColor = new SolidColorBrush();
            var a = APITools.API.loadColors();
            dyeColor.Color = Color.FromArgb(255, 169, 54, 94);
            Rectangles.Fill = dyeColor;
            //{
            //    "colors": {
            //      "126": {
            //        "name": "Hot Pink",
            //        "base_rgb": [ 128, 26, 26 ],
            //        "cloth": {
            //          "brightness": 14,
            //          "contrast": 1.21094,
            //          "hue": 340,
            //          "saturation": 0.820313,
            //          "lightness": 1.44531,
            //          "rgb": [ 169, 54, 94 ]
            //        },
            //}
        }

        private async void Button_Click_2(object sender, RoutedEventArgs e)
        {
            XmlDocument a = await API.LoadNamesFromAPI(Constants.WORLDS);
            d.Text = a.ToString();
        }

        private async void Button_Click_3(object sender, RoutedEventArgs e)
        {
           string Remove23 = await API.loadColors();
            
        }
    }
}
